package cn.wolfcode.crud.domain;

import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

@Setter
@Getter
@ToString
@NoArgsConstructor
public class Courseorder {
    private String ss;
    private Long id;
    private int a;
    private Date inputTime;

    private Customer customer;

    private SystemDictionaryItem course;

    private BigDecimal money;
    public String getJson(){
        Map map=new HashMap();
        map.put("ID",id);
        map.put("money",money);
        if(customer!=null){
            map.put("customerID",customer.getId());
        }
        if(course!=null){
            map.put("courseID",course.getId());
        }

        return JSON.toJSONString(map);
    }

}